package com.wu.foodsafetyplayer.app.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class CarInfoBean implements Parcelable {

    /**
     * data : {"name":"粤B10086","score":0.8}
     * id : 摄像头1
     * image :
     * type : {"name":"大众","score":0.5}
     */

    public DataBean data;
    public String id;
    public String image;
    public TypeBean type;

   
    public static class DataBean implements Parcelable {
        /**
         * name : 粤B10086
         * score : 0.8
         */

        public String name;
        public double score;


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
            dest.writeDouble(this.score);
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.name = in.readString();
            this.score = in.readDouble();
        }

        public static final Parcelable.Creator<DataBean> CREATOR = new Parcelable.Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }

    public static class TypeBean implements Parcelable {
        /**
         * name : 大众
         * score : 0.5
         */

        public String name;
        public double score;


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
            dest.writeDouble(this.score);
        }

        public TypeBean() {
        }

        protected TypeBean(Parcel in) {
            this.name = in.readString();
            this.score = in.readDouble();
        }

        public static final Parcelable.Creator<TypeBean> CREATOR = new Parcelable.Creator<TypeBean>() {
            @Override
            public TypeBean createFromParcel(Parcel source) {
                return new TypeBean(source);
            }

            @Override
            public TypeBean[] newArray(int size) {
                return new TypeBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.data, flags);
        dest.writeString(this.id);
        dest.writeString(this.image);
        dest.writeParcelable(this.type, flags);
    }

    public CarInfoBean() {
    }

    protected CarInfoBean(Parcel in) {
        this.data = in.readParcelable(DataBean.class.getClassLoader());
        this.id = in.readString();
        this.image = in.readString();
        this.type = in.readParcelable(TypeBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<CarInfoBean> CREATOR = new Parcelable.Creator<CarInfoBean>() {
        @Override
        public CarInfoBean createFromParcel(Parcel source) {
            return new CarInfoBean(source);
        }

        @Override
        public CarInfoBean[] newArray(int size) {
            return new CarInfoBean[size];
        }
    };
}
